package com.baselibrary.utils

object SpecUtils {
    // 规格list  转为  空格分隔
    fun getNormsStr4ShopCart(specList: List<String>): String {
        if (specList.size == 0) return ""
        val buffer: StringBuffer = StringBuffer()
        specList.forEach {
            buffer.append(it).append(" ")
        }
        buffer.delete(buffer.length - 1, buffer.length)
        return buffer.toString()
    }
    // 规格list  转为  | 分隔
    fun getNormsStr(specList: List<String>): String {
        val temp="丨"
        if (specList.size == 0) return ""
        val buffer: StringBuffer = StringBuffer()
        specList.forEach {
            buffer.append(it).append(temp)
        }
        buffer.delete(buffer.length - temp.length, buffer.length)
        return buffer.toString()
    }

}